package com.bishe.demo.modules.hotel.hotelDetail.dao;

import com.bishe.demo.modules.hotel.hotelDetail.entity.HotelDetailUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface HotelDetailUserDao {
    @Insert("insert into hotel_detail_user values(null,#{detailId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertHotelDetailUser(HotelDetailUser hotelDetailUser);

    @Delete("delete from hotel_detail_user where user_id=#{hotelId}")
    void deleteByUserId(int hotelId);
}
